package cn.tonyandmoney.warescanapp.rfid.listener

import cn.tonyandmoney.warescanapp.rfid.event.MiEvent
import io.reactivex.subjects.PublishSubject
import mpay.sdk.lib.interfaces.CommandListener
import org.jetbrains.anko.AnkoLogger
import org.jetbrains.anko.info

/**
 * Created by niantuo on 2018/4/1.
 * 这个，简直了
 */
class RxCommandListener(private val rxBus: PublishSubject<Any>) : CommandListener, AnkoLogger {
    override fun onDetectBattery(p0: Boolean, p1: String?) {

    }

    override fun onGetCardInfo(p0: Boolean, p1: String?, p2: String?, p3: String?, p4: String?) {

    }

    override fun onGetReaderSN(p0: Boolean, p1: String?) {

    }

    override fun onGetVersion(p0: Boolean, p1: String?) {

    }

    override fun onGiveUpAction(p0: Boolean) {

    }

    override fun onICCAccess(p0: Boolean, p1: String?) {

    }

    override fun onICCPowerOff(p0: Boolean) {

    }

    override fun onICCPowerOn(p0: Boolean, p1: String?) {

    }

    override fun onICCStatus(p0: Boolean, p1: String?) {

    }

    override fun onMemoryCardGetPSC(p0: Boolean, p1: String?) {

    }

    override fun onMemoryCardGetType(p0: Boolean, p1: String?, p2: String?) {

    }

    override fun onMemoryCardModifyPSC(p0: Boolean) {

    }

    override fun onMemoryCardPowerOff(p0: Boolean) {

    }

    override fun onMemoryCardPowerOn(p0: Boolean, p1: String?) {

    }

    override fun onMemoryCardReadData(p0: Boolean, p1: String?) {

    }

    override fun onMemoryCardReadDataWithProtectBit(p0: Boolean, p1: String?) {

    }

    override fun onMemoryCardReadErrorCounter(p0: Boolean, p1: Int) {

    }

    override fun onMemoryCardReadProtectionData(p0: Boolean, p1: String?) {

    }

    override fun onMemoryCardVerifyPSC(p0: Boolean) {

    }

    override fun onMemoryCardWriteData(p0: Boolean) {

    }

    override fun onMemoryCardWriteDataWithProtectBit(p0: Boolean) {

    }

    override fun onMemoryCardWriteProtectionData(p0: Boolean) {

    }

    override fun onMifareAuth(p0: Boolean) {

    }

    override fun onMifareDecrement(p0: Boolean) {

    }

    override fun onMifareIncrement(p0: Boolean) {

    }

    override fun onMifareReadBlock(p0: Boolean, p1: String?) {

    }

    override fun onMifareWriteBlock(p0: Boolean) {

    }

    override fun onPICCAccess(p0: Boolean, p1: String?) {

    }

    override fun onPICCActivate(state: Boolean, tag: String) {
        info("onPICCActivate state: $state  tag: $tag")
        rxBus.onNext(MiEvent(MiEvent.ACTIVATE, state, tag))
    }

    override fun onPICCDeactivate(p0: Boolean) {

    }

    override fun onPICCRate(p0: Boolean, p1: String?) {

    }

    override fun onReaderResponse(p0: Int, p1: String?, p2: String?) {
        info("onReaderResponse: $p0 $p1 $p2")
    }

    override fun onSDKResponse(p0: Int, p1: String?, p2: String?) {
        info("onSDKResponse $p0 $p1 $p2")
    }

    override fun onSelectMemoryCardType(p0: Boolean) {

    }

    override fun onSetBluetoothDeviceName(p0: Boolean) {

    }

    override fun onSetICCPort(p0: Boolean) {

    }

    override fun onSetReaderSN(p0: Boolean) {

    }

    override fun onSetSleepTimer(p0: Boolean) {

    }

    override fun onSetUseVersion(p0: Boolean) {

    }
}